home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
shazam.exe
/
GEVENT.IMP
< prev
next >
Wrap
Text File
|
1992-09-01
|
17KB
|
502 lines
{*******************************************************************
GEVENT.IMP
*******************************************************************}
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ZOOM
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
{===================================================================
UNZOOM - shrink
===================================================================}
procedure hdUnZoom ;
{-------------------------------------------------------------------
Shrink if full size
-------------------------------------------------------------------}
procedure Action ( P : PView ) ; FAR ;
begin
if IsZoomed ( P ) then
Message ( P , evCommand , cmZoom , NIL ) ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
begin
Desktop^.ForEach ( @Action ) ;
end ;
{===================================================================
ZOOM - expand
===================================================================}
procedure hdZoom ;
{-------------------------------------------------------------------
Expand if not full size
-------------------------------------------------------------------}
procedure Action ( P : PView ) ; FAR ;
begin
if not IsZoomed ( P ) then
Message ( P , evCommand , cmZoom , NIL ) ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
begin
Desktop^.ForEach ( @Action ) ;
end ;
{===================================================================
ALL ZOOMED - return FALSE if any window not zoomed
===================================================================}
function AllZoomed : boolean ;
var
w : word ;
{-------------------------------------------------------------------
Is it full size?
-------------------------------------------------------------------}
procedure Action ( P : PView ) ; FAR ;
begin
if not Zoomable ( P ) then EXIT ;
if not IsZoomed ( P ) then inc ( w ) ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
begin
w := 0 ;
Desktop^.ForEach ( @Action ) ;
AllZoomed := w = 0 ;
end ;
{===================================================================
ZOOM ALL
===================================================================}
procedure hdZoomAll ;
begin
if AllZoomed then
hdUnZoom
else
hdZoom ;
end ;
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MISC
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
{===================================================================
TILE - VERTICAL (standard)
===================================================================}
procedure hdTile ;
var
R : TRect ;
begin
Desktop^.GetExtent ( R ) ;
Desktop^.Tile ( R ) ;
end ;
{===================================================================
CASCADE
===================================================================}
procedure hdCascade ;
var
R : TRect ;
begin
Desktop^.GetExtent ( R ) ;
Desktop^.Cascade ( R ) ;
end ;
{===================================================================
DIRECTORY
===================================================================}
procedure hdChangeDir ;
begin
ExecDialog ( New ( PChDirDialog ,
Init ( cdNormal , 0 ) ) , NIL ) ;
hdRefreshDisplay ;
end ;
{===================================================================
SHOW
===================================================================}
procedure hdShowClipboard ;
begin
ClipWindow^.Select ;
ClipWindow^.Show ;
end ;
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DISPLAY
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
{===================================================================
COPY SCREEN - copy from saved buffer to the Clipboard
===================================================================}
procedure hdCopyScreen ;
var
y : byte ;
Ch : char ;
S : string ;
begin
ClipWindow^.Hide ;
VisionOFF ;
PullScreen ; { From saved buffer }
with ClipWindow^.Editor^ do
begin
SetSelect ( 0 , BufLen , TRUE ) ; { all text }
DeleteSelect ; { dump it }
for y := 1 to BiosHeight do { ROW }
begin
S := GetLine ( y , SaveScreen ) ;
S := TrimRight ( S , #32 ) ;
InsertText ( @S[1] , length ( S ) , FALSE ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AVOID CR/LF ON LAST LINE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
if y < BiosHeight then
begin
Ch := #13 ;
InsertText ( @Ch , 1 , FALSE ) ; { add CR }
Ch := #10 ; { add LF }
InsertText ( @Ch , 1 , FALSE ) ;
end ;
end ;
end ;
VisionON ;
ClipWindow^.Select ;
ClipWindow^.Show ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Goto top line
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
Message ( ClipWindow , evKeyDown , kbCtrlPgUp , NIL ) ;
end ;
{===================================================================
REDRAW
===================================================================}
procedure hdRefreshDisplay ;
begin
DoneMemory ; { Dump cache buffers }
Application^.Redraw ; { Redisplay all }
end ;
{===================================================================
USER SCREEN
===================================================================}
procedure hdUserScreen ;
{-------------------------------------------------------------------
-------------------------------------------------------------------}
procedure Hide ( P : PView ) ; FAR ;
begin
P^.Hide ;
end ;
{-------------------------------------------------------------------
-------------------------------------------------------------------}
procedure Show ( P : PView ) ; FAR ;
begin
P^.Show ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROCESS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
var
Event : TEvent ;
begin
if SaveScreen = NIL then EXIT ;
HideMouse ;
Application^.ForEach ( @Hide ) ;
Application^.Hide ;
Message ( Application ,
evBroadcast ,
cmCommandSetChanged ,
NIL ) ;
VisionOFF ;
InitEvents ;
PullScreen ; { From saved buffer }
Application^.ClearEvent ( Event ) ;
while Event.What = evNothing do
begin
Application^.GetEvent ( Event ) ;
case Event.What of
evCommand : ;
evBroadCast : ;
evKeyDown : ;
evMouseDown : ;
else
Application^.ClearEvent ( Event ) ;
end ;
end ;
DoneEvents ;
VisionON ;
Application^.ClearEvent ( Event ) ;
Application^.ForEach ( @Show ) ;
Application^.Show ;
ShowMouse ;
hdRefreshDisplay ; { redraw screen }
Message ( Application ,
evBroadcas